class Solution(object):
    def deleteDuplicates(self, head):
        """
        :type head: ListNode
        :rtype: ListNode
        """
        dummyHead = ListNode()
        dummyHead.next = head
        cur = dummyHead
        while cur is not None:
            tmp = cur.next

            if tmp is not None and tmp.next is not None and tmp.val == tmp.next.val:
                #跳过相等的点
                while tmp is not None and tmp.next is not None and tmp.val == tmp.next.val:
                    tmp = tmp.next
                #删除中间的点
                cur.next = tmp.next
            else:
                cur = tmp
        return dummyHead.next
